﻿<!DOCTYPE html>
<html>
<head>
    <title>CGI</title>
</head>
<body>
    <h1>Our Page</h1>
    <script>
        //01

        if (55 < 66)
            console.log('true');
        else
            console.log('false');

        if (55 <= 55)
            console.log('true');
        else
            console.log('false');

        if (55 > 55)
            console.log('true');
        else
            console.log('false');

        if (55 >= 55)
            console.log('true');
        else
            console.log('false');


        //02
        //alphabetically less than
        //ACII character comparison, upercase come before lowercase
        /*
        if ("alpha" < "beta")
            console.log('true');
        else
            console.log('false');

        if ("alpha" < "alpha")
            console.log('true');
        else
            console.log('false');

        if ("Beta" < "alpha")
            console.log('true');
        else
            console.log('false');

        if ("Beta".toLowerCase() < "alpha".toLowerCase())
            console.log('true');
        else
            console.log('false');
        */

        //03
        /*
        if ('42' < 55)
            console.log('true');
        else
            console.log('false');

        //this is not a numeric comparison as both strings, 1 comes before 4
        if ('42' < '142')
            console.log('true');
        else
            console.log('false');
        */

        //04
        //common bug, possible case when we compare with NaN
        //nothing
        /*
        var total = NaN;
        if (total < 5)
            console.log('less than 5');
        if (total >= 5)
            console.log('greater than or equal to 5');
        */
    </script>
</body>
</html>